#include "Collision.h"

bool checkQ(Quad a, Quad b)
{
	int leftA, leftB;
	int rightA, rightB;
	int topA, topB;
	int bottomA, bottomB;

	leftA = a.x;
	rightA = a.x + a.w;
	topA = a.y;
	bottomA = a.y + a.h;

	leftB = b.x;
	rightB = b.x + b.w;
	topB = b.y;
	bottomB = b.y + b.h;

	if( bottomA <= topB )
	{
		return false;
	}

	if( topA >= bottomB )
	{
		return false;
	}

	if( rightA <= leftB )
	{
		return false;
	}

	if( leftA >= rightB )
	{
		return false;
	}

	return true;
}

bool checkPP(std::vector<Quad> a, std::vector<Quad> b)
{
	for(int x = 0; x < a.size(); x++)
	{

		for(int y = 0; y < b.size(); y++)
		{
			if(checkQ(a[x], b[y]))
				return true;
		}
	}

	return false;
}

bool checkCirc()
{
	/*
	 * This function has not been implemented yet.
	 * Feel free to implement this function in your own manner in the mean time.
	 *
	 * This function is used to check collisions between objects based on
	 * a trajectory vector and a radius. (Used for round objects if you hadn't guessed.
	 */
	return false;
}
